package com.shiroexploit.vulnverifier;

import com.shiroexploit.util.Config;

public class VerifierFactory {
    private Verifier verifier;
    public static VerifierFactory factory = new VerifierFactory();

    private VerifierFactory(){}

    public static VerifierFactory getInstance(){
        return factory;
    }

    public Verifier getVerifier(){
        if(Config.getInstance().getVulType() == 0){
            if(Config.getInstance().getCheckMethod() == 0){
                verifier = new Shiro550VerifiertUsingCeye();
            }else if(Config.getInstance().getCheckMethod() == 1){
                verifier = new Shiro550VerifiertUsingDNSLog();
            }else if(Config.getInstance().getCheckMethod() == 2){
                verifier = new Shiro550VerifiertWithJRMP();
            }else{
                verifier = new Shiro550VerifierUsingEcho();
            }
        }else{
            if(Config.getInstance().getCheckMethod() == 0){
                verifier = new Shiro721VerifiertUsingCeye();
            }else if(Config.getInstance().getCheckMethod() == 1){
                verifier = new Shiro721VerifiertUsingDNSLog();
            }
            else{
                verifier = new Shiro721VerifierWithJRMP();
            }
        }

        return verifier;
    }
}
